package com.yunhe.openapi.client.fallback;

import com.yunhe.common.model.ResultObject;
import com.yunhe.openapi.client.MeasRealtimeClient;
import com.yunhe.openapi.util.FallbackUtil;
import feign.hystrix.FallbackFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

@Component
public class MeasRealtimeClientFallback implements FallbackFactory<MeasRealtimeClient> {
    @Override
    public MeasRealtimeClient create(Throwable cause) {
        return new MeasRealtimeClient() {

            @Override
            public ResponseEntity<ResultObject> getMeasureRealtime(String pointNumber) {
                return FallbackUtil.getDefaultFallBack();
            }
        };
    }
}
